import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/home.vue'
import Login from '../components/login.vue'
import Main from '../components/main.vue'
import SystemAdmin from '../components/admin/systemAdmin.vue'
import User from '../components/user/user.vue'
import LibrarianAdmin from '../components/admin/librarianAdmin.vue'
import BookCat from '../components/bookInfo/bookCat.vue'
import Book from '../components/bookInfo/book.vue'
import LibrarianAdminLog from '../components/admin/librarianAdminLog.vue'
import AddBook from '../components/bookInfo/addBook.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  { path: '/home', component: Home },
  { path: '/login', component: Login },
  { path: '/main', component: Main,
      children : [
        {path: '/systemAdmin',component:SystemAdmin},
        {path: '/user',component:User},
        {path: '/librarianAdmin',component : LibrarianAdmin},
        {path: '/bookCat',component : BookCat},
        {path: '/book',component : Book},
        {path: '/log',component : LibrarianAdminLog},
        {path: '/book/addBook',component : AddBook}
      ]
  }
]

const router = new VueRouter({
  routes
})

export default router
